<!DOCTYPE html>
<html lang="en">
    <!-- title -->




<!-- keywords -->




<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no" >
    <meta name="author" content="驿路星辰">
    <meta name="renderer" content="webkit">
    <meta name="copyright" content="驿路星辰">
    
    <meta name="keywords" content="算法,Swift,Dart,iOS,Flutter,C++">
    
    <meta name="description" content="">
    <meta name="description" content="常用密码技术1.密码1.1 发送者、接收者和窃听者 假设Alice向Bob发送消息。在这个场景中，发出消息的Alice称为 发送者（sender），而收到消息的Bob则称为 接收者（receiver）。   Alice向Bob发送邮件     消息在互联网上传输的时候，可能被恶意窃听者窃听偷看到。   Eve（窃听者）看到消息的内容    裸露的消息内容原本应该只有发送者和接收者两个人知道，但是在">
<meta property="og:type" content="article">
<meta property="og:title" content="1.密码学 ---《图解密码学》">
<meta property="og:url" content="http://kurumi.gitee.io/shanks/2020/04/29/crypt-one-md/index.html">
<meta property="og:site_name" content="Hexo">
<meta property="og:description" content="常用密码技术1.密码1.1 发送者、接收者和窃听者 假设Alice向Bob发送消息。在这个场景中，发出消息的Alice称为 发送者（sender），而收到消息的Bob则称为 接收者（receiver）。   Alice向Bob发送邮件     消息在互联网上传输的时候，可能被恶意窃听者窃听偷看到。   Eve（窃听者）看到消息的内容    裸露的消息内容原本应该只有发送者和接收者两个人知道，但是在">
<meta property="og:locale" content="en_US">
<meta property="og:image" content="http://kurumi.gitee.io/shanks/2020/04/29/crypt-one-md/1538728596743.png">
<meta property="og:image" content="http://kurumi.gitee.io/shanks/2020/04/29/crypt-one-md/1538728627477.png">
<meta property="og:image" content="http://kurumi.gitee.io/shanks/2020/04/29/crypt-one-md/1538728678781.png">
<meta property="og:image" content="http://kurumi.gitee.io/shanks/2020/04/29/crypt-one-md/1538728746711.png">
<meta property="og:image" content="http://kurumi.gitee.io/shanks/2020/04/29/crypt-one-md/1538728869719.png">
<meta property="og:image" content="http://kurumi.gitee.io/shanks/2020/04/29/crypt-one-md/1538728964328.png">
<meta property="og:image" content="http://kurumi.gitee.io/shanks/2020/04/29/crypt-one-md/1538814978185.png">
<meta property="article:published_time" content="2020-04-29T01:11:14.000Z">
<meta property="article:modified_time" content="2022-05-28T19:11:40.113Z">
<meta property="article:author" content="驿路星辰">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://kurumi.gitee.io/shanks/2020/04/29/crypt-one-md/1538728596743.png">
    <meta http-equiv="Cache-control" content="no-cache">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    
    <title>1.密码学 ---《图解密码学》 · iOS</title>
    <style type="text/css">
    @font-face {
        font-family: 'Oswald-Regular';
        src: url("/shanks/font/Oswald-Regular.ttf");
    }

    body {
        margin: 0;
    }

    header,
    footer,
    .back-top,
    .sidebar,
    .container,
    .site-intro-meta,
    .toc-wrapper {
        display: none;
    }

    .site-intro {
        position: relative;
        z-index: 3;
        width: 100%;
        /* height: 30vh; */
        overflow: hidden;
    }

    .site-intro-placeholder {
        position: absolute;
        z-index: -2;
        top: 0;
        left: 0;
        width: calc(100% + 300px);
        height: 100%;
        background: repeating-linear-gradient(-45deg, #444 0, #444 80px, #333 80px, #333 160px);
        background-position: center center;
        transform: translate3d(-226px, 0, 0);
        animation: gradient-move 2.5s ease-out 0s infinite;
    }

    @keyframes gradient-move {
        0% {
            transform: translate3d(-226px, 0, 0);
        }
        100% {
            transform: translate3d(0, 0, 0);
        }
    }

</style>

    <link rel="preload" href= "/shanks/css/style.css?v=20180824" as="style" onload="this.onload=null;this.rel='stylesheet'" />
    <link rel="stylesheet" href= "/shanks/css/mobile.css?v=20180824" media="(max-width: 980px)">
    
    <link rel="preload" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.2.5/jquery.fancybox.min.css" as="style" onload="this.onload=null;this.rel='stylesheet'" />
    
    <!-- /*! loadCSS. [c]2017 Filament Group, Inc. MIT License */
/* This file is meant as a standalone workflow for
- testing support for link[rel=preload]
- enabling async CSS loading in browsers that do not support rel=preload
- applying rel preload css once loaded, whether supported or not.
*/ -->
<script>
(function( w ){
	"use strict";
	// rel=preload support test
	if( !w.loadCSS ){
		w.loadCSS = function(){};
	}
	// define on the loadCSS obj
	var rp = loadCSS.relpreload = {};
	// rel=preload feature support test
	// runs once and returns a function for compat purposes
	rp.support = (function(){
		var ret;
		try {
			ret = w.document.createElement( "link" ).relList.supports( "preload" );
		} catch (e) {
			ret = false;
		}
		return function(){
			return ret;
		};
	})();

	// if preload isn't supported, get an asynchronous load by using a non-matching media attribute
	// then change that media back to its intended value on load
	rp.bindMediaToggle = function( link ){
		// remember existing media attr for ultimate state, or default to 'all'
		var finalMedia = link.media || "all";

		function enableStylesheet(){
			link.media = finalMedia;
		}

		// bind load handlers to enable media
		if( link.addEventListener ){
			link.addEventListener( "load", enableStylesheet );
		} else if( link.attachEvent ){
			link.attachEvent( "onload", enableStylesheet );
		}

		// Set rel and non-applicable media type to start an async request
		// note: timeout allows this to happen async to let rendering continue in IE
		setTimeout(function(){
			link.rel = "stylesheet";
			link.media = "only x";
		});
		// also enable media after 3 seconds,
		// which will catch very old browsers (android 2.x, old firefox) that don't support onload on link
		setTimeout( enableStylesheet, 3000 );
	};

	// loop through link elements in DOM
	rp.poly = function(){
		// double check this to prevent external calls from running
		if( rp.support() ){
			return;
		}
		var links = w.document.getElementsByTagName( "link" );
		for( var i = 0; i < links.length; i++ ){
			var link = links[ i ];
			// qualify links to those with rel=preload and as=style attrs
			if( link.rel === "preload" && link.getAttribute( "as" ) === "style" && !link.getAttribute( "data-loadcss" ) ){
				// prevent rerunning on link
				link.setAttribute( "data-loadcss", true );
				// bind listeners to toggle media back
				rp.bindMediaToggle( link );
			}
		}
	};

	// if unsupported, run the polyfill
	if( !rp.support() ){
		// run once at least
		rp.poly();

		// rerun poly on an interval until onload
		var run = w.setInterval( rp.poly, 500 );
		if( w.addEventListener ){
			w.addEventListener( "load", function(){
				rp.poly();
				w.clearInterval( run );
			} );
		} else if( w.attachEvent ){
			w.attachEvent( "onload", function(){
				rp.poly();
				w.clearInterval( run );
			} );
		}
	}


	// commonjs
	if( typeof exports !== "undefined" ){
		exports.loadCSS = loadCSS;
	}
	else {
		w.loadCSS = loadCSS;
	}
}( typeof global !== "undefined" ? global : this ) );
</script>

    <link rel="icon" href= "/shanks/assets/favicon.ico" />
    <link rel="preload" href="https://cdn.jsdelivr.net/npm/webfontloader@1.6.28/webfontloader.min.js" as="script" />
    <link rel="preload" href="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js" as="script" />
    <link rel="preload" href="/shanks/scripts/main.js" as="script" />
    <link rel="preload" as="font" href="/shanks/font/Oswald-Regular.ttf" crossorigin>
    <link rel="preload" as="font" href="https://at.alicdn.com/t/font_327081_1dta1rlogw17zaor.woff" crossorigin>
    
    <!-- fancybox -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.2.5/jquery.fancybox.min.js" defer></script>
    <!-- 百度统计  -->
    
    <!-- 谷歌统计  -->
    
<meta name="generator" content="Hexo 4.2.1"></head>

    
        <body class="post-body">
    
    
<header class="header">

    <div class="read-progress"></div>
    <div class="header-sidebar-menu">&#xe775;</div>
    <!-- post页的toggle banner  -->
    
    <div class="banner">
            <div class="blog-title">
                <a href="/shanks/" >驿路星辰的博客</a>
            </div>
            <div class="post-title">
                <a href="#" class="post-name">1.密码学 ---《图解密码学》</a>
            </div>
    </div>
    
    <a class="home-link" href=/shanks/>驿路星辰的博客</a>
</header>
    <div class="wrapper">
        <div class="site-intro" style="







height:50vh;
">
    
    <!-- 主页  -->
    
    
    <!-- 404页  -->
            
    <div class="site-intro-placeholder"></div>
    <div class="site-intro-img" style="background-image: url(/shanks/intro/post-bg.jpg)"></div>
    <div class="site-intro-meta">
        <!-- 标题  -->
        <h1 class="intro-title">
            <!-- 主页  -->
            
            1.密码学 ---《图解密码学》
            <!-- 404 -->
            
        </h1>
        <!-- 副标题 -->
        <p class="intro-subtitle">
            <!-- 主页副标题  -->
            
            
            <!-- 404 -->
            
        </p>
        <!-- 文章页meta -->
        
            <div class="post-intros">
                <!-- 文章页标签  -->
                
                
                    <div class="post-intro-read">
                        <span>Word count: <span class="post-count word-count">1.5k</span>Reading time: <span class="post-count reading-time">5 min</span></span>
                    </div>
                
                <div class="post-intro-meta">
                    <span class="post-intro-calander iconfont-archer">&#xe676;</span>
                    <span class="post-intro-time">2020/04/29</span>
                    
                    <span id="busuanzi_container_page_pv" class="busuanzi-pv">
                        <span class="iconfont-archer">&#xe602;</span>
                        <span id="busuanzi_value_page_pv"></span>
                    </span>
                    
                    <span class="shareWrapper">
                        <span class="iconfont-archer shareIcon">&#xe71d;</span>
                        <span class="shareText">Share</span>
                        <ul class="shareList">
                            <li class="iconfont-archer share-qr" data-type="qr">&#xe75b;
                                <div class="share-qrcode"></div>
                            </li>
                            <li class="iconfont-archer" data-type="weibo">&#xe619;</li>
                            <li class="iconfont-archer" data-type="qzone">&#xe62e;</li>
                            <li class="iconfont-archer" data-type="twitter">&#xe634;</li>
                            <li class="iconfont-archer" data-type="facebook">&#xe67a;</li>
                        </ul>
                    </span>
                </div>
            </div>
        
    </div>
</div>
        <script>
 
  // get user agent
  var browser = {
    versions: function () {
      var u = window.navigator.userAgent;
      return {
        userAgent: u,
        trident: u.indexOf('Trident') > -1, //IE内核
        presto: u.indexOf('Presto') > -1, //opera内核
        webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
        gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
        mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
        ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
        android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器
        iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, //是否为iPhone或者安卓QQ浏览器
        iPad: u.indexOf('iPad') > -1, //是否为iPad
        webApp: u.indexOf('Safari') == -1, //是否为web应用程序，没有头部与底部
        weixin: u.indexOf('MicroMessenger') == -1, //是否为微信浏览器
        uc: u.indexOf('UCBrowser') > -1 //是否为android下的UC浏览器
      };
    }()
  }
  console.log("userAgent:" + browser.versions.userAgent);

  // callback
  function fontLoaded() {
    console.log('font loaded');
    if (document.getElementsByClassName('site-intro-meta')) {
      document.getElementsByClassName('intro-title')[0].classList.add('intro-fade-in');
      document.getElementsByClassName('intro-subtitle')[0].classList.add('intro-fade-in');
      var postIntros = document.getElementsByClassName('post-intros')[0]
      if (postIntros) {
        postIntros.classList.add('post-fade-in');
      }
    }
  }

  // UC不支持跨域，所以直接显示
  function asyncCb(){
    if (browser.versions.uc) {
      console.log("UCBrowser");
      fontLoaded();
    } else {
      WebFont.load({
        custom: {
          families: ['Oswald-Regular']
        },
        loading: function () {  //所有字体开始加载
          // console.log('loading');
        },
        active: function () {  //所有字体已渲染
          fontLoaded();
        },
        inactive: function () { //字体预加载失败，无效字体或浏览器不支持加载
          console.log('inactive: timeout');
          fontLoaded();
        },
        timeout: 5000 // Set the timeout to two seconds
      });
    }
  }

  function asyncErr(){
    console.warn('script load from CDN failed, will load local script')
  }

  // load webfont-loader async, and add callback function
  function async(u, cb, err) {
    var d = document, t = 'script',
      o = d.createElement(t),
      s = d.getElementsByTagName(t)[0];
    o.src = u;
    if (cb) { o.addEventListener('load', function (e) { cb(null, e); }, false); }
    if (err) { o.addEventListener('error', function (e) { err(null, e); }, false); }
    s.parentNode.insertBefore(o, s);
  }

  var asyncLoadWithFallBack = function(arr, success, reject) {
      var currReject = function(){
        reject()
        arr.shift()
        if(arr.length)
          async(arr[0], success, currReject)
        }

      async(arr[0], success, currReject)
  }

  asyncLoadWithFallBack([
    "https://cdn.jsdelivr.net/npm/webfontloader@1.6.28/webfontloader.min.js", 
    "https://cdn.bootcss.com/webfont/1.6.28/webfontloader.js",
    "/shanks/lib/webfontloader.min.js"
  ], asyncCb, asyncErr)
</script>        
        <img class="loading" src="/shanks/assets/loading.svg" style="display: block; margin: 6rem auto 0 auto; width: 6rem; height: 6rem;" />
        <div class="container container-unloaded">
            <main class="main post-page">
    <article class="article-entry">
        <h1 id="常用密码技术"><a href="#常用密码技术" class="headerlink" title="常用密码技术"></a>常用密码技术</h1><h2 id="1-密码"><a href="#1-密码" class="headerlink" title="1.密码"></a>1.密码</h2><h3 id="1-1-发送者、接收者和窃听者"><a href="#1-1-发送者、接收者和窃听者" class="headerlink" title="1.1 发送者、接收者和窃听者"></a>1.1 发送者、接收者和窃听者</h3><blockquote>
<p>假设Alice向Bob发送消息。在这个场景中，发出消息的Alice称为 <strong>发送者（sender）</strong>，而收到消息的Bob则称为 <strong>接收者（receiver）</strong>。</p>
</blockquote>
<ul>
<li><p><strong>Alice向Bob发送邮件</strong></p>
<p><img src="1538728596743.png" alt="1538728596743"></p>
</li>
</ul>
<blockquote>
<p>消息在互联网上传输的时候，可能被恶意窃听者窃听偷看到。</p>
</blockquote>
<ul>
<li><strong>Eve（窃听者）看到消息的内容</strong></li>
</ul>
<p><img src="1538728627477.png" alt="1538728627477"></p>
<blockquote>
<p>裸露的消息内容原本应该只有发送者和接收者两个人知道，但是在传输的过程中就存在被第三方知道的风险。</p>
</blockquote>
<h3 id="1-2-加密和解密"><a href="#1-2-加密和解密" class="headerlink" title="1.2 加密和解密"></a>1.2 加密和解密</h3><blockquote>
<p>Alice不想让别人看到消息的内容，于是可以对消息进行<strong>加密（encrypt）</strong>后再发送出去。</p>
<p>加密之前的消息称为<strong>明文（plaintext）</strong>，加密之后的消息称为<strong>密文（cipher-text）</strong>。</p>
</blockquote>
<p><img src="1538728678781.png" alt="1538728678781"></p>
<blockquote>
<p>Bob收到了来自Alice的<strong>加密消息</strong>，于是Bob需要对密文进行<strong>解密（decrypt）</strong>之后再阅读。</p>
</blockquote>
<ul>
<li><p><strong>密文解密之后就变成了原来的明文</strong></p>
<p><img src="1538728746711.png" alt="1538728746711"></p>
</li>
</ul>
<ul>
<li><p><strong>将消息加密后发送, 窃听者只能得到密文</strong></p>
<p><img src="1538728869719.png" alt="1538728869719"></p>
</li>
</ul>
<h3 id="1-3-秘钥"><a href="#1-3-秘钥" class="headerlink" title="1.3 秘钥"></a>1.3 秘钥</h3><h4 id="1-3-1-密码算法"><a href="#1-3-1-密码算法" class="headerlink" title="1.3.1 密码算法"></a>1.3.1 密码算法</h4><blockquote>
<p>把明文加密成密文的过程,称为“加密算法”,而密文解密成明文的过程，称为“解密算法”。加密、解密的算法合在一起统称为<strong>密码算法</strong>。</p>
</blockquote>
<h4 id="1-3-2-秘钥"><a href="#1-3-2-秘钥" class="headerlink" title="1.3.2 秘钥"></a>1.3.2 秘钥</h4><blockquote>
<p>密码算法中需要<strong>密钥（key）</strong>。就如同现实生活中的钥匙一样，我们要打开锁，必须要用匹配的钥匙。</p>
</blockquote>
<ul>
<li><p><strong>使用密钥进行加密、解密</strong></p>
<p><img src="1538728964328.png" alt="1538728964328"></p>
</li>
</ul>
<h3 id="1-4-密码信息安全常识与威胁"><a href="#1-4-密码信息安全常识与威胁" class="headerlink" title="1.4 密码信息安全常识与威胁"></a>1.4 密码信息安全常识与威胁</h3><h4 id="1-4-1-信息安全常识"><a href="#1-4-1-信息安全常识" class="headerlink" title="1.4.1 信息安全常识"></a>1.4.1 信息安全常识</h4><ul>
<li>不要使用保密的密码算法</li>
<li>使用低强度的密码比不进行任何加密更危险</li>
<li>任何密码总有一天都会被破解</li>
<li>密码只是信息安全的一部分</li>
</ul>
<h5 id="不要使用保密的密码算法"><a href="#不要使用保密的密码算法" class="headerlink" title="不要使用保密的密码算法"></a>不要使用保密的密码算法</h5><blockquote>
<p>这样做的原因主要有以下两点：</p>
</blockquote>
<ul>
<li><p><strong>密码算法的秘密早晚会公诸于世</strong></p>
<blockquote>
<ol>
<li><p>从历史上看，密码算法的秘密最终都会被暴露出来。例如: RSA公司开发的RC4密码算法曾经也是保密的，但最终还是有一位匿名人士开发并公开了与其等效的程序。</p>
</li>
<li><p>公开的算法从一开始就没有设想过要保密，因此算法的暴露丝毫不会削弱它们的强度。</p>
</li>
</ol>
</blockquote>
</li>
<li><p><strong>开发高强度的密码算法是非常困难的</strong></p>
<blockquote>
<ul>
<li>要比较密码算法的强弱是极其困难的，因为密码算法的强度并不像数学那样可以进行严密的证明。密码算法的强度只能通过事实来证明，如果专业密码破译者经过数年的尝试仍然没有破解某个密码算法，则说明这种算法的强度较高。</li>
<li>现在世界上公开的被认为强度较高的密码算法，几乎都是经过密码破译者长期尝试破解未果而存活下来的</li>
<li>试图通过对密码算法本身进行保密来确保安全性的行为，一般称为隐蔽式安全性（securitybyobscurity），这种行为是危险且愚蠢的。</li>
<li>反过来说，将密码算法的详细信息以及程序源代码全部交给专业密码破译者，并且为其提供大量的明文和密文样本，如果在这样的情况下破译一段新的密文依然需要花上相当长的时间，就说明这是高强度的密码。</li>
</ul>
</blockquote>
</li>
</ul>
<h5 id="使用低强度的密码比不进行任何加密更危险"><a href="#使用低强度的密码比不进行任何加密更危险" class="headerlink" title="使用低强度的密码比不进行任何加密更危险"></a>使用低强度的密码比不进行任何加密更危险</h5><blockquote>
<p>一般我们会认为．就算密码的强度再低，也比完全不加密要强吧？其实这样的想法是非常危险的。</p>
<p><strong>正确的想法应该是：</strong>与其使用低强度的密码，还不如从一开始就不使用任何密码这主要是由于用户容易通过“密码”这个词获得一种“错误的安全感”。对于用户来说，安全感与密码的强度无关，而只是由“信息已经被加密了”这一事实产生的，而这通常会导致用户在处理一些机密信息的时候麻痹大意。</p>
</blockquote>
<h5 id="任何密码总有一天会被破译"><a href="#任何密码总有一天会被破译" class="headerlink" title="任何密码总有一天会被破译"></a>任何密码总有一天会被破译</h5><blockquote>
<p>如果某种密码产品宣称“本产品使用了绝对不会被破解的密码算法”，那么你就要对这个产品的安全性打个问号了，这是因为绝对不会被破解的密码是不存在的。</p>
<p>无论使用任何密码算法所生成的密文，只要将所有可能的密钥全部尝试一遍，就总有一天可以破译出来。因此，破译密文所需要花费的时间，与要保密的明文的价值之间的权衡就显得非常重要。</p>
</blockquote>
<h5 id="密码只是信息安全的一部分"><a href="#密码只是信息安全的一部分" class="headerlink" title="密码只是信息安全的一部分"></a>密码只是信息安全的一部分</h5><blockquote>
<p>我们还是回到Alice给Bob发送加密消息的例子。即便不去破解密码算法，也依然有很多方法能够知道Alice所发送的邮件内容, 例如: </p>
<p><strong>攻击者可以不去试图破译经过加密的邮件，而是转而攻击Alice的电脑以获取加密之前的邮件明文。</strong></p>
<p>上面提到的攻击手段，都与密码的强度毫无关系。要保证良好的安全性，就需要理解“系统”这一概念本身的性质复杂的系统就像一根由无数个环节相连组成的链条，如果用力拉，链条就会从其中最脆弱的环节处断开。因此，系统的强度取决于其中最脆弱的环节的强度。</p>
<p>最脆弱的环节并不是密码，而是人类自己。</p>
</blockquote>
<h4 id="1-4-2-密码信息威胁"><a href="#1-4-2-密码信息威胁" class="headerlink" title="1.4.2 密码信息威胁"></a>1.4.2 密码信息威胁</h4><blockquote>
<p>我们将信息安全所面临的威胁与用来用对这些威胁的密码技术直接的关系用一张图标来表示出来。</p>
</blockquote>
<p><img src="1538814978185.png" alt="1538814978185"></p>

    </article>
    <!-- license  -->
    
        <div class="license-wrapper">
            <p>Author：<a href="http://kurumi.gitee.io/shanks">驿路星辰</a>
            <p>原文链接：<a href="http://kurumi.gitee.io/shanks/2020/04/29/crypt-one-md/">http://kurumi.gitee.io/shanks/2020/04/29/crypt-one-md/</a>
            <p>发表日期：<a href="http://kurumi.gitee.io/shanks/2020/04/29/crypt-one-md/">April 29th 2020</a>
            <p>更新日期：<a href="http://kurumi.gitee.io/shanks/2020/04/29/crypt-one-md/">April 29th 2020</a>
            <p>版权声明：本文采用<a rel="license noopener" href="http://creativecommons.org/licenses/by-nc/4.0/" target="_blank">知识共享署名-非商业性使用 4.0 国际许可协议</a>进行许可</p>
        </div>
    
    <!-- paginator  -->
    <ul class="post-paginator">
        <li class="next">
            
                <div class="nextSlogan">Next Post</div>
                <a href= "/shanks/2020/04/30/crypt-two-md/" title= "2.对称加密（相同密钥加解密)---《图解密码学》">
                    <div class="nextTitle">2.对称加密（相同密钥加解密)---《图解密码学》</div>
                </a>
            
        </li>
        <li class="previous">
            
                <div class="prevSlogan">Previous Post</div>
                <a href= "/shanks/2020/03/27/ios-gcd-ptread/" title= "iOS 90%人可能都会回答错误的一个多线程基础题">
                    <div class="prevTitle">iOS 90%人可能都会回答错误的一个多线程基础题</div>
                </a>
            
        </li>
    </ul>
    <!-- 评论插件 -->
    <!-- 来必力City版安装代码 -->

<!-- City版安装代码已完成 -->
    
    
    <!-- gitalk评论 -->

    <!-- utteranc评论 -->

    <!-- partial('_partial/comment/changyan') -->
    <!--PC版-->


    
    

    <!-- 评论 -->
</main>
            <!-- profile -->
            
        </div>
        <footer class="footer footer-unloaded">
    <!-- social  -->
    
    <div class="social">
        
    
        
            
                <a href="mailto:ayaseeri@126.com" class="iconfont-archer email" title=email ></a>
            
        
    
        
            
                <a href="//github.com/esdeath" class="iconfont-archer github" target="_blank" title=github></a>
            
        
    
        
    
        
    

    </div>
    
    <!-- powered by Hexo  -->
    <div class="copyright">
        <span id="hexo-power">Powered by <a href="https://hexo.io/" target="_blank">Hexo</a></span><span class="iconfont-archer power">&#xe635;</span><span id="theme-info">theme <a href="https://github.com/fi3ework/hexo-theme-archer" target="_blank">Archer</a></span>
    </div>
    <!-- 不蒜子  -->
    
    <div class="busuanzi-container">
    
     
    <span id="busuanzi_container_site_pv">PV: <span id="busuanzi_value_site_pv"></span> :)</span>
    
    </div>
    
</footer>
    </div>
    <!-- toc -->
    
    <div class="toc-wrapper" style=
    







top:50vh;

    >
        <div class="toc-catalog">
            <span class="iconfont-archer catalog-icon">&#xe613;</span><span>CATALOG</span>
        </div>
        <ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#常用密码技术"><span class="toc-number">1.</span> <span class="toc-text">常用密码技术</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#1-密码"><span class="toc-number">1.1.</span> <span class="toc-text">1.密码</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#1-1-发送者、接收者和窃听者"><span class="toc-number">1.1.1.</span> <span class="toc-text">1.1 发送者、接收者和窃听者</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#1-2-加密和解密"><span class="toc-number">1.1.2.</span> <span class="toc-text">1.2 加密和解密</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#1-3-秘钥"><span class="toc-number">1.1.3.</span> <span class="toc-text">1.3 秘钥</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#1-3-1-密码算法"><span class="toc-number">1.1.3.1.</span> <span class="toc-text">1.3.1 密码算法</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#1-3-2-秘钥"><span class="toc-number">1.1.3.2.</span> <span class="toc-text">1.3.2 秘钥</span></a></li></ol></li><li class="toc-item toc-level-3"><a class="toc-link" href="#1-4-密码信息安全常识与威胁"><span class="toc-number">1.1.4.</span> <span class="toc-text">1.4 密码信息安全常识与威胁</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#1-4-1-信息安全常识"><span class="toc-number">1.1.4.1.</span> <span class="toc-text">1.4.1 信息安全常识</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#不要使用保密的密码算法"><span class="toc-number">1.1.4.1.1.</span> <span class="toc-text">不要使用保密的密码算法</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#使用低强度的密码比不进行任何加密更危险"><span class="toc-number">1.1.4.1.2.</span> <span class="toc-text">使用低强度的密码比不进行任何加密更危险</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#任何密码总有一天会被破译"><span class="toc-number">1.1.4.1.3.</span> <span class="toc-text">任何密码总有一天会被破译</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#密码只是信息安全的一部分"><span class="toc-number">1.1.4.1.4.</span> <span class="toc-text">密码只是信息安全的一部分</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#1-4-2-密码信息威胁"><span class="toc-number">1.1.4.2.</span> <span class="toc-text">1.4.2 密码信息威胁</span></a></li></ol></li></ol></li></ol></li></ol>
    </div>
    
    <div class="back-top iconfont-archer">&#xe639;</div>
    <div class="sidebar sidebar-hide">
    <ul class="sidebar-tabs sidebar-tabs-active-0">
        <li class="sidebar-tab-archives"><span class="iconfont-archer">&#xe67d;</span><span class="tab-name">Archive</span></li>
        <li class="sidebar-tab-tags"><span class="iconfont-archer">&#xe61b;</span><span class="tab-name">Tag</span></li>
        <li class="sidebar-tab-categories"><span class="iconfont-archer">&#xe666;</span><span class="tab-name">Cate</span></li>
    </ul>
    <div class="sidebar-content sidebar-content-show-archive">
          <div class="sidebar-panel-archives">
    <!-- 在ejs中将archive按照时间排序 -->
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    <div class="total-and-search">
        <div class="total-archive">
        Total : 16
        </div>
        <!-- search  -->
        
    </div>
    
    <div class="post-archive">
    
    
    
    
    <div class="archive-year"> 2020 </div>
    <ul class="year-list">
    
    
        <li class="archive-post-item">
            <span class="archive-post-date">08/29</span><a class="archive-post-title" href= "/shanks/2020/08/29/flutter-ios-plugin-delegate-error/" >Flutter中针对iOS封装Plugin组件注意事项</a>
        </li>
    
    
        <li class="archive-post-item">
            <span class="archive-post-date">08/29</span><a class="archive-post-title" href= "/shanks/2020/08/29/flutter-mvvm/" >Flutter中使用Provider实现MVVM架构</a>
        </li>
    
    
        <li class="archive-post-item">
            <span class="archive-post-date">06/07</span><a class="archive-post-title" href= "/shanks/2020/06/07/crypt-night/" >9.SSL/TLS(为了更安全的通信)---《图解密码学》</a>
        </li>
    
    
        <li class="archive-post-item">
            <span class="archive-post-date">05/31</span><a class="archive-post-title" href= "/shanks/2020/05/31/crypt-eight/" >8.证书(为公钥加上数字签名)---《图解密码学》</a>
        </li>
    
    
        <li class="archive-post-item">
            <span class="archive-post-date">05/29</span><a class="archive-post-title" href= "/shanks/2020/05/29/crypt-seven/" >7.数字签名(消息到底是谁写的)---《图解密码学》</a>
        </li>
    
    
        <li class="archive-post-item">
            <span class="archive-post-date">05/21</span><a class="archive-post-title" href= "/shanks/2020/05/21/crypt-six/" >6.消息认证码(消息被正确传送了吗)---《图解密码学》</a>
        </li>
    
    
        <li class="archive-post-item">
            <span class="archive-post-date">05/12</span><a class="archive-post-title" href= "/shanks/2020/05/12/crypt-five-md/" >5.单向散列函数(获取消息的指纹)---《图解密码学》</a>
        </li>
    
    
        <li class="archive-post-item">
            <span class="archive-post-date">05/08</span><a class="archive-post-title" href= "/shanks/2020/05/08/crypt-four-md/" >4.非对称加密(公钥加密,私钥解密)---《图解密码学》</a>
        </li>
    
    
        <li class="archive-post-item">
            <span class="archive-post-date">05/05</span><a class="archive-post-title" href= "/shanks/2020/05/05/crypt-three-md/" >3. 分组密码的模式(分组密码是如何迭代)---《图解密码学》</a>
        </li>
    
    
        <li class="archive-post-item">
            <span class="archive-post-date">04/30</span><a class="archive-post-title" href= "/shanks/2020/04/30/crypt-two-md/" >2.对称加密（相同密钥加解密)---《图解密码学》</a>
        </li>
    
    
        <li class="archive-post-item">
            <span class="archive-post-date">04/29</span><a class="archive-post-title" href= "/shanks/2020/04/29/crypt-one-md/" >1.密码学 ---《图解密码学》</a>
        </li>
    
    
        <li class="archive-post-item">
            <span class="archive-post-date">03/27</span><a class="archive-post-title" href= "/shanks/2020/03/27/ios-gcd-ptread/" >iOS 90%人可能都会回答错误的一个多线程基础题</a>
        </li>
    
    
        <li class="archive-post-item">
            <span class="archive-post-date">01/27</span><a class="archive-post-title" href= "/shanks/2020/01/27/how-to-know-highorlow-computer-md/" >如何判断机器的字节顺序是高字节在前还是低字节在前</a>
        </li>
    
    
    
    
    
        </ul>
    
    <div class="archive-year"> 2019 </div>
    <ul class="year-list">
    
    
        <li class="archive-post-item">
            <span class="archive-post-date">10/11</span><a class="archive-post-title" href= "/shanks/2019/10/11/swift-function-program/" >【译】Swift和函数式编程的精髓</a>
        </li>
    
    
        <li class="archive-post-item">
            <span class="archive-post-date">10/03</span><a class="archive-post-title" href= "/shanks/2019/10/03/how-to-use-functional-program-in-swift/" >【译】如何在swift中使用函数式编程</a>
        </li>
    
    
        <li class="archive-post-item">
            <span class="archive-post-date">08/28</span><a class="archive-post-title" href= "/shanks/2019/08/28/swift-operator-override/" >【译】如何在swift中使用函数式编程</a>
        </li>
    
    </div>
  </div>
        <div class="sidebar-panel-tags">
    <div class="sidebar-tags-name">
    
    </div>
    <div class="iconfont-archer sidebar-tags-empty">&#xe678;</div>
    <div class="tag-load-fail" style="display: none; color: #ccc; font-size: 0.6rem;">
    缺失模块。<br/>
    1、请确保node版本大于6.2<br/>
    2、在博客根目录（注意不是archer根目录）执行以下命令：<br/>
    <span style="color: #f75357; font-size: 1rem; line-height: 2rem;">npm i hexo-generator-json-content --save</span><br/>
    3、在根目录_config.yml里添加配置：
    <pre style="color: #787878; font-size: 0.6rem;">
jsonContent:
  meta: false
  pages: false
  posts:
    title: true
    date: true
    path: true
    text: false
    raw: false
    content: false
    slug: false
    updated: false
    comments: false
    link: false
    permalink: false
    excerpt: false
    categories: true
    tags: true</pre>
    </div> 
    <div class="sidebar-tags-list"></div>
</div>
        <div class="sidebar-panel-categories">
    <div class="sidebar-categories-name">
    
    </div>
    <div class="iconfont-archer sidebar-categories-empty">&#xe678;</div>
    <div class="sidebar-categories-list"></div>
</div>
    </div>
</div> 
    <script>
    var siteMeta = {
        root: "/shanks/",
        author: "驿路星辰"
    }
</script>
    <!-- CDN failover -->
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.3.1/dist/jquery.min.js"></script>
    <script type="text/javascript">
        if (typeof window.$ === 'undefined')
        {
            console.warn('jquery load from jsdelivr failed, will load local script')
            document.write('<script src="/shanks/lib/jquery.min.js">\x3C/script>')
        }
    </script>
    <script src="/shanks/scripts/main.js"></script>
    <!-- algolia -->
    
    <!-- busuanzi  -->
    
    <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
    
    <!-- CNZZ  -->
    
    </div>
    <!-- async load share.js -->
    
        <script src="/shanks/scripts/share.js" async></script>    
     
    </body>
</html>


